#/*
#	/******************************************************************************
#   * This file is part of xn5106 platform,
#	* Copyright (c) 2009 HangZhou InfoStrong CO.,LTD. All rights reserved.
#   * This software may only be used under the terms of a valid, current,
#	* end user license from InfoStrong.
#	* Nothing else gives you the right to use this software.
#	*
#	* Name:   Ver_cfg.mmk
#	* Desc:   SW version string definitions
#	* Author: Jerry
#	* Date:   2012-03-22
#	* Note:
#   * History:
#	*
#	******************************************************************************/
##################################################################################
#                    
##################################################################################
## SW version string definitions

# Attention: no space to be inserted.
VER_NUM :=3.03.15
# Ver type id: AMR, DDT, IOT, SEC. 
VER_TYPE_ID := FLC
ifeq ($(BOARD_ID), SLC_PCB_14_P04_02_V10)
VER_TYPE_ID := SLC
endif
ifeq ($(BOARD_ID), SLC_PCB_14_P04_02_V13)
VER_TYPE_ID := SLC
endif
ifeq ($(BOARD_ID), DLC_PCB_14_P04_07_V11)
VER_TYPE_ID := DLC
endif
ifeq ($(BOARD_ID), DLC_PCB_14_P04_07_V12)
VER_TYPE_ID := DLC
endif
ifeq ($(BOARD_ID), DLC_PCB_16_P06_01_V10)
VER_TYPE_ID := DLC
endif
ifeq ($(BOARD_ID), SLC_PCB_16_P04_30_V10)
VER_TYPE_ID := SLC
endif
# Ver Node id: M(master), S(Slave), D(Dp_node), C(Collector)
VER_NODE_ID := S
ifeq ($(strip $(DP_NODE_FLG)), TRUE)
VER_NODE_ID := D
endif
ifeq ($(strip $(LOG_FLG)), TRUE)
VER_NODE_ID := L
endif
# Ver debug or release flag: D(Debug), R(Release),I(inspect)
VER_DEBUG_REL :=R

# Please add VER_CHIP_ID and CHIP_ID_ALL
# Ver chip id: 02(XN5106C), 03(XN5101), 04(XN5107), 05(MR32DT16), 06(MR32DT20) etc
ifeq ($(strip $(CFG_CHIP_ID)), XN5106C)
VER_CHIP_ID := 02
XN5106C_EXT_FLG := TRUE
endif
ifeq ($(strip $(CFG_CHIP_ID)), XN5101)
VER_CHIP_ID := 03
XN5106C_EXT_FLG := TRUE
endif
ifeq ($(strip $(CFG_CHIP_ID)), XN5107)
VER_CHIP_ID := 04
XN5106C_EXT_FLG := TRUE
endif
ifeq ($(strip $(CFG_CHIP_ID)), MR32DT16)
VER_CHIP_ID := 05
XN5106C_EXT_FLG := TRUE
endif

CHIP_ID_ALL = XN5106A=1 XN5106C=2 XN5101=3 XN5107=4 MR32DT16=5 MR32DT20=6

# Ver customer ID: 00(commom), 01(Creaway), etc
# Please add VER_CUSTOMER_ID and CUSTOMER_ID_ALL
ifeq ($(strip $(CUSTOMER_ID)), COMMON)
VER_CUSTOMER_ID = 00
endif
ifeq ($(strip $(CUSTOMER_ID)), CREAWAY)
VER_CUSTOMER_ID = 01
endif
ifeq ($(strip $(CUSTOMER_ID)), SUNRISE)
VER_CUSTOMER_ID = 02
endif
ifeq ($(CUSTOMER_ID), SANXING)
VER_CUSTOMER_ID = 03
endif
ifeq ($(strip $(CUSTOMER_ID)), HEXING)
VER_CUSTOMER_ID = 04
endif
ifeq ($(strip $(CUSTOMER_ID)), JINGUO)
VER_CUSTOMER_ID = 06
endif
ifeq ($(strip $(CUSTOMER_ID)), YONGDIAN)
VER_CUSTOMER_ID = 07
endif
ifeq ($(strip $(CUSTOMER_ID)), FJASL)
VER_CUSTOMER_ID = 11
endif
ifeq ($(strip $(CUSTOMER_ID)), FOREIGN)
VER_CUSTOMER_ID = 14
endif

CUSTOMER_ID_ALL = COMMON=0 CREAWAY=1 SUNRISE=2 SANXING=3 HEXING=4 SHUNZHOU=5 JINGUO=6 YONGDIAN=7 FJASL=11 FOREIGN=14

ifeq ($(strip $(BIND_FLG)), TRUE)
VER_BIND_CHAR +=B
else
VER_BIND_CHAR +=N
endif

ifeq ($(strip $(LOG_FLG)), TRUE)
CFG_SIMU_UART_FLG = FALSE
endif
ifeq ($(strip $(CFG_SIMU_UART_FLG)), TRUE)
VER_SIMU_UART_CHAR +=S
else
VER_SIMU_UART_CHAR +=N
endif

ifeq ($(strip $(CFG_EXT_WDT_FLG)), TRUE)
VER_EXT_WDT_CHAR +=4
else
VER_EXT_WDT_CHAR +=N
endif

ifeq ($(strip $(CFG_SYM2400_FLG)), TRUE)
VER_RATE_CHAR +=3
else
VER_RATE_CHAR +=2
endif

ifeq ($(strip $(CFG_EXT_FLASH_FLG)), TRUE)
VER_EXT_FLASH_CHAR +=F
else
VER_EXT_FLASH_CHAR +=N
endif


VER_NVRAM_CHAR += E
VER_UART_CHECK_CHAR += E

empty:=#Empty char
space:= $(empty) $(empty)#Space char

# AMR_Mxx.xx.xxR_NNBCCSWFR
VER_TOTAL_PRE =$(VER_TYPE_ID)_$(VER_NODE_ID)$(VER_NUM)$(VER_DEBUG_REL)_$(VER_CHIP_ID)$(VER_BIND_CHAR)$(VER_CUSTOMER_ID)$(VER_SIMU_UART_CHAR)$(VER_EXT_WDT_CHAR)$(VER_EXT_FLASH_CHAR)$(VER_RATE_CHAR)$(VER_UART_CHECK_CHAR)$(VER_NVRAM_CHAR)
VER_TOTAL =$(subst $(space),$(empty),$(VER_TOTAL_PRE))
VER_TOTAL_STR = \""$(VER_TOTAL)"\"

